<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        .box{width: 937px;margin: 0 auto;}
        .yhdl{border:1px solid #000; height:500px;width:430px}
        .no1{transform:translate(80px,20px)}
        .no2{transform:translate(70px)}
        .anniu2{transform:translate(100px)}
        .yhdl,.tupian{display: inline-block;vertical-align: top;}
        #sp1{margin-right: 65px}
        #sp2{margin-right: 65px}
        #sp3{margin-right: 33px}
        #sp4{margin-right: 17px}
        #sp5{margin-right: 8px}
        /*input{display: block;*/
        /*margin-bottom: 1px}*/
    </style>
    <script src="/js/jquery-1.12.4.js"></script>
</head>
<body>
<div class="box">
    <div class="tupian">
        <img src="img/0a.jpg" height="500" width="500"/>
    </div>
    <div class="yhdl">
        <div class="no1">
            <h1 class="no2">邮箱注册</h1>
            <form action="/register" method="post">
                <p><span id="sp1">邮箱:</span><input type="text" id="ema" name="emas" placeholder="请输入邮箱" /><p/>
                <p><span id="sp2">密码:</span><input type="text" name="pwd" placeholder="请输入密码" /><p/>
                <p><span id="sp3">确认密码:</span><input type="text" name="pwd2" placeholder="确认密码" /><p/>
                <p><span id="sp4">邮箱验证码:</span><input id="emas" type="text" name="ema" placeholder="验证码" />
                <input id="fs" type="button" name="fs" value="发送" /><p/>
                <p><span id="sp5">邀请码(可选):</span><input type="text" name="yqm" placeholder="邀请码(可选)" /><p/>
                <input class="anniu2" type="submit" id="zhuce" name="ema" value="注册" style="width:150px;height:35px" disabled="true"/><br/><br/>
                <input type="radio" id="radios"  name="ty"/><span class="tk">同意所有条款</span>
            </form>
        </div>
    </div>
</div>

<script>
    var ty = $("input[name=ty]:checked").val();
    $("#radios").click(function (){
        if (ty==true){
            $("#zhuce").attr("disabled",true);
        }else {
            $("#zhuce").attr("disabled",false);
        }
    })

    $("#fs").click(function (){
        var ema=$("#ema").val();
        $.ajax({
            "url": "/emailyz",
            "type": "POST",
            "data":{"ema":ema},
            "dataType": "json",
            "success": function(res) {
                alert("发送成功,请注意接收")
                alert(ema+"====")
            },
            "error": function() {
                alert("验证码发送失败");
                alert(ema+"====")
            }
        })
    })
</script>
</body>
</html>